package com.zyj.myapplication.Model;

import android.app.ListActivity;

import com.zyj.myapplication.Javabean.AskList;
import com.zyj.myapplication.Javabean.VideoList;
import com.zyj.myapplication.Javabean.Coach;
import com.zyj.myapplication.Javabean.CoachInfo;
import com.zyj.myapplication.Service.CoachService;

import java.util.List;

import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * Created by Administrator on 2017/10/23.
 */

public class CoachModel {
    private Retrofit retrofit;
    public CoachModel() {
        retrofit = new Retrofit.Builder()
                .addConverterFactory(GsonConverterFactory.create())
                .baseUrl("http://172.24.10.175/workout/api.php/")
                .build();
    }
    public Call<List<Coach>>getcoachList(){
        CoachService coachService = retrofit.create(CoachService.class);
        return coachService.getCoachList();
    }
    public Call<CoachInfo>getCoachinfo(String id){
       CoachService coachService =  retrofit.create(CoachService.class);
        return coachService.getCoachinfo("lgj98rfkiqvenhrk2o7oe2po81","master",id);
    }
    public Call<List<AskList>> getAskList(String master_id){
        CoachService coachService = retrofit.create(CoachService.class);
        return coachService.getAskList(master_id);
    }
    public Call<VideoList> getVideoList(String Id,String map){
        CoachService coachService = retrofit.create(CoachService.class);
        return coachService.getVideoList(Id,map);
    }
}
